<template>
  <!-- location -->
  <div class="position">
    <i class="iconfont icon-location"></i>
    北京理工大学国防科技园2号楼10层
    <i class="iconfont icon-bell"></i>
  </div>
  <!-- search -->
  <RouterLink class="search" to="/search">
    <i class="iconfont icon-search"></i>
    <input type="text" placeholder="山姆会员商店优惠商品" />
  </RouterLink>
  <!-- banner -->
  <div class="banner">
    <img
      class="banner__img"
      src="http://www.dell-lee.com/imgs/vue3/banner.jpg"
      alt=""
    />
  </div>
  <!-- icons -->
  <div class="icons">
    <div class="icons__item" v-for="item in iconList" :key="item.desc">
      <img
        class="icons__item__img"
        :src="`http://www.dell-lee.com/imgs/vue3/${item.img}.png`"
        :alt="item.desc"
      />
      <p class="icons__item__desc">{{ item.desc }}</p>
    </div>
  </div>
  <!-- gap -->
  <div class="gap"></div>
</template>

<script>
export default {
  name: 'StaticPart',
  setup() {
    const iconList = [
      { img: '超市', desc: '超市便利' },
      { img: '菜市场', desc: '菜市场' },
      { img: '水果店', desc: '水果店' },
      { img: '鲜花', desc: '鲜花绿植' },
      { img: '医药健康', desc: '医药健康' },
      { img: '家居', desc: '家居时尚' },
      { img: '蛋糕', desc: '烘焙蛋糕' },
      { img: '签到', desc: '签到' },
      { img: '大牌免运', desc: '大牌免运' },
      { img: '红包', desc: '红包套餐' },
    ];

    return { iconList };
  },
};
</script>

<style lang="scss" scoped>
@import '../../style/variables.scss';
@import '../../style/mixins.scss';
.position {
  position: relative;
  padding: 0.16rem 0.24rem 0.16rem 0;
  line-height: 0.22rem;
  font-size: 0.16rem;
  @include ellipsis;
  .icon-location {
    position: relative;
    top: 0.01rem;
    font-size: 0.2rem;
  }
  .icon-bell {
    position: absolute;
    top: 0.17rem;
    right: 0;
    font-size: 0.2rem;
  }
  color: $content-fontColor;
}
// -----------------
.search {
  margin-bottom: 0.12rem;
  line-height: 0.32rem;
  background: $search-bgColor;
  border-radius: 0.16rem;
  color: $search-fontColor;
  font-size: 0.14rem;
  padding: 0 0.2rem;
  display: flex;
  align-content: center;
  > i {
    font-size: 0.2rem;
  }
  input {
    border: 0;
    outline: 0;
    background-color: transparent;
    flex: 1;
    padding: 0 0.15rem;
  }
}
// ------------------
.banner {
  height: 0;
  overflow: hidden;
  padding-bottom: 25.4%;
  &__img {
    width: 100%;
  }
}
// ----------------------
.icons {
  display: flex;
  flex-wrap: wrap;
  margin-top: 0.16rem;
  &__item {
    width: 20%;
    &__img {
      display: block;
      width: 0.4rem;
      height: 0.4rem;
      margin: 0 auto;
    }
    &__desc {
      margin: 0.06rem 0 0.16rem;
      text-align: center;
      color: $content-fontColor;
    }
  }
}
// ---------------------
// 中间留白
.gap {
  margin: 0 -0.18rem;
  height: 0.1rem;
  background: $content-bgColor;
}
</style>
